<!-- 3  
 * @Description: What's this for
 * @Autor: WangYuan
 * @Date: 2022-01-13 15:31:38
 * @LastEditors: WangYuan
 * @LastEditTime: 2022-01-18 11:52:36
-->
<template>
  <div class="control">
    <control-widgets />

    <control-panel />
    <!-- 右侧操作栏 -->
    <control-config />
  </div>
</template>

<script>
import ControlWidgets from "./ControlWidgets.vue";
import ControlPanel from "./ControlPanel.vue";
import ControlConfig from "./ControlConfig.vue";

export default {
  name: "control",

  components: {
    ControlWidgets,
    ControlPanel,
    ControlConfig,
  },

  provide() {
    return {
      control: this,
      curpageTemp: "",
    };
  },

  data() {
    return {
      dragstatus: false,
      curWidget: null,
      dragWidget: null,
      curPage: null,
    };
  },
  created() {
    this.$store.getters.data().pagecontrol = this;
    this.curPage = this.$store.getters.data().CurPage;
    //console.log('页面',this.$store.getters.data().pagecontrol)
  },
  computed: {
    // curPage:function(){
    //   console.log('CurPage',this.curpageTemp)
    //   if(typeof this.curpageTemp==='undefined'){
    //    return this.$store.getters.data().CurPage;
    //   }else{
    //   return this.curpageTemp;}
    // }
    //...mapGetters(["curPage"]),
  },
  activated() {
    this.curPage = this.$store.getters.data().CurPage;
  },
};
</script>

<style lang='scss'>
.control {
  position: relative;
  height: calc(100% - 56px); /*no*/
  overflow: hidden;
}
</style>